package com.hancher.common.androidutil;

import java.util.HashMap;

/**
 * 作者 : Hancher ytu_shaoweijie@163.com <br/>
 * 时间 : 2023/6/10 15:53 <br/>
 * 描述 :
 */
public class FastClickUtil {

    public static long lastClick = 0;
    public static HashMap<String, Long> lastClickMap = new HashMap<>();

    public static boolean isQuick() {
        boolean quick = System.currentTimeMillis() - lastClick < 1000;
        lastClick = System.currentTimeMillis();
        return quick;
    }

    public static boolean isQuick(String str) {
        long last = lastClickMap.get(str) == null ? 0 : lastClickMap.get(str);
        boolean quick = System.currentTimeMillis() - last < 1000;
        lastClickMap.put(str, System.currentTimeMillis());
        return quick;
    }
}
